#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
	FILE *pFile1=NULL, *pFile2=NULL;
	char p1[256],p2[256];
	int i=0;
	pFile1=fopen("test1.txt","r");
    pFile2=fopen("test2.txt","r");



	 while (!feof(pFile1) && !feof(pFile1)) 
	 {
		 fgets(p1,256,pFile1);
		 fgets(p2,256,pFile2);
		 i++;
		 if(strcmp(p1,p2))
			 break;
		 
	 }

	 if((!feof(pFile2) && !feof(pFile1)) || (!feof(pFile2) && feof(pFile1)) || (feof(pFile2) && !feof(pFile1)))
		 printf("Mismatch in line %d\n", i);
	 else
	 printf("Discrepancies found\n");

	fclose(pFile1);
    fclose(pFile2);

	system("PAUSE");
}